<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JSON对象的创建</title>
	</head>
	<body>
		<h1>JSON对象的创建</h1>
		<script>
			person={
				name:'Jack',
				age:20,//最后一个属性不加逗号
				addr:{
					homeAddr:'太原迎泽区',
					workAddr:'太原小店'				
				}
			};
			alert(person.addr.homeAddr);//打印
			alert(person['age']);//取得属性值：加点，加括号和引号
			students=[
			{name:'wzj',age:43},
			{name:'zhaolaoshi',age:40}
			];
			alert(students[1].age)
			s={
		    "sites": [
		    { "name":"菜鸟教程" , "url":"www.runoob.com" }, 
		    { "name":"google" , "url":"www.google.com" }, 
		    { "name":"微博" , "url":"www.weibo.com" }
		    ]
		}//数组和对象相互嵌套
		</script>
	</body>
</html>
